<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../node_modules/jquery/dist/jquery.js"></script>
</head>
<body>
<span class="span1" name="zs"></span>
<span class="span2" name="ls"></span>
<input type="checkbox">
<script>
     $(function () {
         /**
          prop(n|p|k,v|f)
            特点和attr一致
          removeProp(name)
          特点和removeAttr一致
          */
         /*
         $("span").eq(0).prop("demo","666");
         $("span").eq(1).prop("demo","777");
         console.log($("span").prop("demo"));
         $("span").removeProp("demo")*/
         /**
          * 注意点
          * porp方法不仅能够操作属性，还能操作属性节点
          *
          * 在判断checked display selected...使用prop 其余使用 attr
          */
         // console.log($("span").prop("class"));
         // $("span").prop("class","box");

         console.log($("input").prop("checked"));//true /false
         console.log($("input").attr("checked"));//checked /undefined
     });

</script>
</body>
</html>